package cn.chendd.cofig.filters;

import org.springframework.util.MultiValueMap;

/**
 * @author chendd
 * @date 2023/1/1 10:23
 */
public class GatewayContext {

    /**
     * 缓存request body的key
     */
    public static final String REQUEST_BODY_CACHE_GATEWAY_CONTEXT = "REQUEST_BODY_CACHE_GATEWAY_CONTEXT";

    /**
     * 记录请求参数日志的范围名称
     */
    public static final String HTTP_PARAM_SCOPE = "HTT_PARAM_SCOPE";

    /**
     * 请求1MB的字节大小
     */
    public static final int LOG_UPLOAD_SIZE = 1024 * 1024;

    /**
     * requestBody记录日志的最大字节大小，小于此参数的请求记录参数信息，否则输出文件地址
     */
    public static final int LOG_UPLOAD_MAX_SIZE = LOG_UPLOAD_SIZE * 5;

    /**
     * 请求body
     */
    private String requestBody;

    /**
     * 响应body
     */
    private String responseBody;

    /**
     * form数据
     */
    private MultiValueMap<String, String> formData;

    public MultiValueMap<String, String> getFormData() {
        return formData;
    }

    public void setFormData(MultiValueMap<String, String> formData) {
        this.formData = formData;
    }

    public String getRequestBody() {
        return requestBody;
    }

    public void setRequestBody(String requestBody) {
        this.requestBody = requestBody;
    }

    public String getResponseBody() {
        return responseBody;
    }

    public void setResponseBody(String responseBody) {
        this.responseBody = responseBody;
    }
}
